﻿// =====================================================    
// Author: hexid26
// Email : hexid26@outlook.com
// Date  : 2015/07/06
// This code is for sharing
// Copyright (C)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ToukidenKiwamiAssist
{
    public partial class ShareForm : Form
    {
        static int type = 0;
        public string rt = "";
        public ShareForm(string text)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterParent;

            this.Text = "分享配魂";
            type = 0;
            btnOK.Text = "点击复制";
            textBox.Text = text;
            labelInfo.Text = "复制文本框中代码，分享你的乐趣吧！";
        }

        public ShareForm()
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterParent;
            type = 1;
            this.Text = "导入配魂";
            btnOK.Text = "导入";
            textBox.Text = "";
            textBox.ReadOnly = false;
            labelInfo.Text = "请将代码粘贴到文本框中";
        }

        private void OK_Click(object sender, EventArgs e)
        {
            if (type == 0)//分享
            {
                Clipboard.SetText(textBox.Text);
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
            else          //导入
            {
                rt = textBox.Text;
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
        }
    }
}
